package xxhui.space.newsclient.Http;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import xxhui.space.newsclient.Bean.News;
import xxhui.space.newsclient.Bean.UserData;

/**
 * Created by home on 2017/8/3.
 */

public interface NewsService {
    @FormUrlEncoded
    @POST("/user/login")
    Observable<UserData> login(@Field("username") String username, @Field("password") String password);

    @GET("news")
    Observable<News> getArticle(@Query("page")int page , @Query("page_size")int page_size);

    @FormUrlEncoded
    @POST("/user/nickname")
    Observable<UserData> modifyNickName(@Field("nickname") String nickname);

}
